﻿using System.Collections.Generic;

// ReSharper disable CheckNamespace
namespace System.Linq
// ReSharper restore CheckNamespace
{
    /// <summary>
    /// IEnumerable extensions
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Executes an action on each item in an enumeration
        /// </summary>
        /// <typeparam name="T">Type of item in enumeration</typeparam>
        /// <param name="enumerable">Enumeration to process</param>
        /// <param name="action">Action to execute</param>
        public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
        {
            foreach (T item in enumerable) action(item);
        }
    }
}
